
******************************************************************************************************************************************************************
******************************************************************************************************************************************************************
*************Data transformations for: "Cadasters and Economic Growth: A Long-Run Cross-Country Panel" D'Arcy, Nistotskaya & Olsson, JPE, R3, November, 2023*******************


***DATA TRANSFORMATIONS***
*Note: Main explanatory variable is "cad", our main Cadaster index. Main outcome variable is "y2", Log real GDP per capita (2011 prices) from Bolt and van Zanden (MPD, 2020). See some data transformations below.

use "${datapath}\cadaster_main.dta", clear

*Dummy=1 if cad=1
gen cad_full=0 
replace cad_full=1 if cad==1

*Dummy=1 if cad=0
gen cad_no=0 
replace cad_no=1 if cad==0

*Changes (reforms) in cad
gen cad_reform = cad - l.cad

*Dummy=1 if cad=1 and lagged level of cad<1, capturing transitions to full cadastral institutions
gen tcad=.
replace tcad=1 if cad==1&l.cad<1
replace tcad=0 if cad<1&l.cad<1  

*Generate lags of y
gen lag1y2=l1.y2
gen lag2y2=l2.y2
gen lag3y2=l3.y2
gen lag4y2=l4.y2 

*Generate lags of d.y
gen d_y2=d.y2 
gen l_d_y2=l.d.y2 
gen l2_d_y2=l2.d.y2
gen l3_d_y2=l3.d.y2
gen l4_d_y2=l4.d.y2

*Generating income differentials leads and lags in dependent variables
gen y2dep0=L6.y-L.y
gen y2dep1=L5.y-L.y
gen y2dep2=L4.y-L.y
gen y2dep3=L3.y-L.y
gen y2dep4=L2.y-L.y
gen y2dep5=0                        

* Creates leads of GDP *
gen y2dep6=y-L.y
gen y2dep7=F1.y-L.y
gen y2dep8=F2.y-L.y
gen y2dep9=F3.y-L.y
gen y2dep10=F4.y-L.y
gen y2dep11=F5.y-L.y
gen y2dep12=F6.y-L.y
gen y2dep13=F7.y-L.y
gen y2dep14=F8.y-L.y
gen y2dep15=F9.y-L.y
gen y2dep16=F10.y-L.y



